<%--
  Created by IntelliJ IDEA.
  User: Chuch
  Date: 2017/5/3
  Time: 20:26
--%>
<%--
  @TODO 参考接口文档，查询展示；预留状态修改按钮【冻结】【锁定】，先不做实现
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common/taglibs.jsp" %>
<html>
<head>
    <title>绑卡报表统计</title>
    <script src="${ctx}/js/views/payCount/agreementRateReportApp.js"></script>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
<core:import url="../common/pageHead.jsp">
    <core:param name="title" value="绑卡报表统计"/>
</core:import>
<div ng-controller="queryCtrl" class="container-fluid">
    <form id="queryForm" name="queryForm" action="${ctx}/cif/agreementRateReport/search" autocomplete="off" role="form">
        <table class="table table-bordered table-condensed">
            <tr>
                <td class="text-right">银行名称</td>
                <td>
                    <input type="text" ng-model="vm.queryBean.bankName" class="{{vm.constant.inputClass}}"
                           typeahead-min-length="0"   uib-typeahead="item.key as item.value for item in vm.getCache('T_BANK_CODE') | filter:$viewValue | limitTo:10">

                </td>
                <td class="text-right">交易日期</td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup
                           ng-blur="vm.checkStartDay(vm.queryBean.startTime,vm.queryBean.endTime)"
                           ng-model="vm.queryBean.startTime" required/>
                    -
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup
                           ng-blur="vm.checkEndDay(vm.queryBean.startTime,vm.queryBean.endTime)"
                           ng-model="vm.queryBean.endTime" required/>
                </td>
            </tr>
            <tr align="center">
                <td colspan="6">
                    <button type="button" ng-click="vm.queryDetail()" class="btn btn-default">
                        查询
                    </button>
                    <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>

                    <shiro:hasPermission name="refund-report_download">
                        <button down-file="${ctx}/cif/agreementRateReport/download" params="vm.queryBean"
                                down-file-type="xls" class="btn btn-default" down-cfg="vm.downCfg">
                            下载
                        </button>
                    </shiro:hasPermission>
                </td>
            </tr>
        </table>
    </form>

    <div>
        <table table-detail>
            <thead>
            <tr>
                <th rowspan="2">序号</th>
                <th rowspan="2">支付机构</th>
                <th rowspan="2">银行名称</th>
                <th rowspan="2">账号类型</th>
                <th rowspan="2">申请开始日期</th>
                <th rowspan="2">申请结束日期</th>
                <th colspan="10">绑卡率</th>
            </tr>
            <tr>
                <th>总申请数</th>
                <th>申请成功</th>
                <th>申请失败</th>
                <th>成功占比</th>
                <th>失败占比</th>
                <th>签约总数</th>
                <th>签约成功</th>
                <th>签约失败</th>
                <th>成功占比</th>
                <th>失败占比</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="bean in vm.pagination.list track by $index">
                <td>{{$index+1}}</td>
                <td>
                    <span ng-if="bean.orgCode == null">未知</span>
                    <span ng-if="bean.orgCode != null">
                        {{vm.cached.COMANY_CODE[bean.orgCode]}}({{bean.orgCode}})
                    </span>
                </td>
                <td>{{bean.bankName}}
                </td>
                <%--<td>{{vm.cached.BANK_INFO[bean.bankCode]}}({{bean.bankCode}})
                </td>--%>
                <td>
                    <span ng-if="bean.cardType == 'DB'">借记卡</span>
                    <span ng-if="bean.cardType == 'CD'">贷记卡</span>
                </td>
                <td>{{bean.startTime}}</td>
                <td>{{bean.endTime}}</td>
                <td>{{bean.applyTotal}}</td>
                <td>{{bean.applySuccessTotal}}</td>
                <td>{{bean.applyFailTotal}}</td>
                <td>{{bean.applySuccessRate}}</td>
                <td>{{bean.applyFailRate}}</td>
                <td>{{bean.boundTotal}}</td>
                <td>{{bean.boundSuccessTotal}}</td>
                <td>{{bean.boundFailTotal}}</td>
                <td>{{bean.boundSuccessRate}}</td>
                <td>{{bean.boundFailRate}}</td>
            </tr>
            </tbody>
            <tr>
                <td></td><td></td><td></td><td></td><td></td>
                <td>总计</td>
                <td>{{vm.totalCount.applyTotal}}</td>
                <td>{{vm.totalCount.applySuc}}</td>
                <td>{{vm.totalCount.applyFail}}</td>
                <td>{{vm.totalCount.applySucRate}}</td>
                <td>{{vm.totalCount.applyFailRate}}</td>
                <td>{{vm.totalCount.boundTotal}}</td>
                <td>{{vm.totalCount.boundSuc}}</td>
                <td>{{vm.totalCount.boundFail}}</td>
                <td>{{vm.totalCount.boundSucRate}}</td>
                <td>{{vm.totalCount.boundFailRate}}</td>
            </tr>
        </table>
        <core:import url="../common/pageFoot.jsp"/>
    </div>
    <core:import url="../common/nav.jsp"/>
</div>
</body>
</html>
